
using FirebaseAdmin;
using Google.Apis.Auth.OAuth2;

namespace LearnNotification
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var builder = WebApplication.CreateBuilder(args);

            // Add controller
            builder.Services.AddControllers();

            // Add services to the container.
            builder.Services.AddAuthorization();

            // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
            builder.Services.AddEndpointsApiExplorer();
            builder.Services.AddSwaggerGen();            

            var app = builder.Build();

            // use Firebase
            FirebaseApp.Create(new AppOptions()
            {
                Credential=GoogleCredential.FromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "learnnotification-588b3-firebase-adminsdk-ckkp1-ff05d4f056.json"))
            });

            // Configure the HTTP request pipeline.
            if (app.Environment.IsDevelopment())
            {
                app.UseSwagger();
                app.UseSwaggerUI();
            }
            app.MapControllers();
            app.UseAuthorization();



            app.Run();
        }
    }
}
